Optical imaging holds tremendous promise in our endeavor to understand brain functions. The major challenges for optical brain imaging are depth and speed. Due to strong tissue scattering, the penetration depth and imaging speed of optical microscopy in the mouse brain are very limited. The constraints in depth and speed make large scale, volumetric imaging of mouse brain activity, e.g., functional imaging of an entire mouse cortical column, out of reach of current imaging techniques. Adaptive optics (AO) have proven to be valuable for in vivo brain imaging, and will have even larger impact for deep brain 3-photon microscopy; however, existing AO techniques require iterative optimization using fluorescence signal when imaging deep within scattering mouse brains, which is incompatible with large scale, volumetric imaging over a large range of depth and field of view. This program will involve the development of a novel 2-photon Shack-Hartmann wavefront sensor (2P-SHWS) for direct measurement of optical wavefront deep within scattering mouse brain, followed by demonstration of the performance of the proposed 2P-SHWS for in vivo multiphoton imaging of mouse brain structure and function. This innovation is based on the realization that the physical principles for deep tissue imaging and deep tissue direct wavefront sensing are essentially the same because they both rely on the information carried by the ballistic photons, and they both require the suppression of the contributions from the scattered excitation photons. Therefore, parallel to the rationales behind multiphoton deep tissue imaging, deep tissue wavefront sensing should also benefit tremendously by the use of long wavelength and nonlinear excitation. The successful completion of this program will provide the unprecedented capability of direct wavefront measurement throughout the depth of the mouse neocortex (800 to 900 m deep) and at an update rate of 1 to 10 Hz (depth dependent) during imaging. With its deep tissue wavefront sensing capability, high update rate, relatively simple implementation, and zero additional photobleaching and phototoxicity, 2P- SHWS is ideally positioned to transform our ability for large-scale, volumetric recording of mouse brain activity.